<?php

namespace App\Models\Entity\Assets;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Assets
 * @package App\Models\Entity\Assets
 * @version July 4, 2018, 5:19 pm CST
 *
 * @property string spid
 * @property string asset_type
 * @property string spasset_id
 */
class AssetStream extends Model
{
    //use SoftDeletes;

    protected $connection = 'xiaole_assets';

    public $table = 'asset_streams';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'asset_id',
        'stream_id',
        'cdn_id',
        'ogroup_asset_id',
        'ogroup_asset_data',
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'asset_id'=>'integer',
        'stream_id'=>'string',
        'cdn_id'=>'string',
        'ogroup_asset_id'=>'string',
        'ogroup_asset_data'=>'string',
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        'asset_id' => 'required'
    ];


    public function asset()
    {
        return $this->belongsTo('App\Models\Entity\Assets\Assets','asset_id');
    }

    
}
